﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace EHR.Common
{
    public class AppCookie
    {
        public string LastLoginName { get; set; }
        public DateTime LastActiveTime { get; set; }

        public AppCookie()
        {
            LastLoginName = "";
        }

        public override string ToString()
        {
            string fmt = "{0};{1}";
            return string.Format(fmt, LastLoginName, LastActiveTime.ToString("yyyy-MM-dd HH:mm:ss"));
        }

        public void FromString(string str)
        {
            string[] array = str.Split(';');
            try
            {
                LastLoginName = array[0];
                LastActiveTime = DateTime.Parse(array[1]);
            }
            catch
            {
 
            }
        }
    }
}
